package com.demo;

import java.util.Scanner;

public class MethodDemo {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入第一个数:");
        int num1 = scanner.nextInt();
        System.out.println("输入第二个数:");
        int num2 = scanner.nextInt();
        int max = getMax(num1,num2);
        System.out.println("最大值是:"+max);
    }

    public static int getMax(int num1,int num2){

        if(num1>num2){
//            System.out.println("您输入的数字中大的数字是:"+num1);
            return num1;
        }else if(num1<num2){
//            System.out.println("您输入的数字中大的数字是:"+num2);
            return num2;
        }else{
            System.out.println("输入的数字一样大");
            return 0;
        }
    }
}
